package com.example.myapplication.WuChangFuBenAdapyer;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.myapplication.WuChangFuBenBean.WuChangFuBenBean;
import com.example.myapplication.R;

import java.util.ArrayList;
import java.util.List;

public class WuChangAdapter extends BaseAdapter {
    List<WuChangFuBenBean>list=new ArrayList<>();
    Activity activity;

    public WuChangAdapter(List<WuChangFuBenBean> list, Activity activity) {
        this.list = list;
        this.activity = activity;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int i) {
        return list.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        view= LayoutInflater.from(activity).inflate(R.layout.wuchangfuben_mokuai,null);
        TextView biaoti=view.findViewById(R.id.WuChangFuBen_biaoti);
        TextView nandu=view.findViewById(R.id.WuChangFuBen_nandu);
        TextView miaoshu=view.findViewById(R.id.WuChangFuBen_miaoshu);
        TextView jiangli=view.findViewById(R.id.WuChangFuBen_jiangli);
        TextView teshu=view.findViewById(R.id.WuChangFuBen_teshu);
        TextView gonglv=view.findViewById(R.id.WuChangFuBen_gonglv);
        TextView renwuhuigu=view.findViewById(R.id.WuChangFuBen_renwuhuigu);
        TextView teshurenwu=view.findViewById(R.id.WuChangFuBen_teshurenwu);
        biaoti.setText(list.get(i).getBiaoti());
        nandu.setText(list.get(i).getNandu());
        miaoshu.setText(list.get(i).getMiaoshu());
        jiangli.setText(list.get(i).getJiangli());
        teshu.setText(list.get(i).getTeshu());
        gonglv.setText(list.get(i).getGonglv());
        renwuhuigu.setText(list.get(i).getRenwuhuigu());
        teshurenwu.setText(list.get(i).getTeshurenwu());

        return view;
    }
}
